<div class="box box-solid">
    <div class="box-body table-responsive no-padding">

        <div class="box-body">
                <div class="form-group">
                    <table class="table table-hover table-bordered">
                        <tr>
                            <th>编号</th>
                            <th>名称</th>
                            <th>状态</th>
                            <th>分类</th>
                            <th>操作</th>
                        </tr>
                            <?php if(!empty($result['data'] )): ?>
                                <?php foreach ($result['data'] as $key => $value) :?>
                                <tr>
                                    <td><?php echo $value['id']; ?></td>
                                    <td><?php echo $value['name']; ?></td>
                                    <td><?php if($value['status'] == CategoryNav::STATUS_NORMAL) echo('<span class="btn btn-sm btn-success">正常</span>') ?><?php if($value['status'] != CategoryNav::STATUS_NORMAL) echo('<span class="btn btn-sm btn-danger ">暂停</span>') ?></td>
                                    <td><?php if(!empty($value['categories'])) {
                                        foreach ($value['categories'] as $k => $v) {

                                            echo "<label class='btn btn-default btn-sm'>".$v['name'].'</label> ';
                                        }
                                        }  ?></td>
                                    <td>
                                        <?php if($value['status'] == CategoryNav::STATUS_NORMAL): ?>    
                                            <a onclick="return confirm('确定要暂停该分类显示吗?');" href='<?php echo $this->createUrl("system/navstatus/id/".$value["id"]) ?>'>暂停</a>
                                        <?php else: ?>
                                            <a onclick="return confirm('确定要启用该分类吗?');" href='<?php echo $this->createUrl("system/navstatus/id/".$value["id"]) ?>'>启用</a>
                                        <?php endif; ?>
                                            <a onclick="return confirm('确定要删除吗?');" href='<?php echo $this->createUrl("system/navdelete/id/".$value["id"]) ?>'>删除</a>
                                        
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tr>
                    </table>
                </div>
            </div>
    <div class="box-footer clearfix">
    <a class="btn btn-default pull-left" href="<?php echo $this->createUrl('system/addnav') ?>"><i class="fa fa-plus"></i> 添加</a>
    <?php if(!empty($result['data'])): ?>
        <?php $this->widget('BLinkPager', array('pages'=>$result['pages'])); ?>
    <?php endif; ?>
    </div>
    </div>
</div>